<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>省市县区三级联动组件</title>
    <link rel="icon" th:href="@{/images/favicon.ico}">
    <link rel="stylesheet" th:href="@{/layuimini/lib/layui-v2.6.3/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/layuimini/css/public.css}" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="ok-body">
            <blockquote class="layui-elem-quote" style="padding: 5px;">
                1.layui第三方扩展组件：<font color="red" size="2">省市县区三级联动(layarea)</font>；
                <a href="https://dev.layuion.com/extend/layarea/" target="_blank" class="layui-btn layui-btn-sm layui-btn-danger">layarea</a><br>
                <br/>
                2.本项目暂时未用到该组件；
            </blockquote>

            <div class="layui-form">
                <div class="layui-form-item" id="area-select">
                <div class="layui-form-label">联系地址</div>
                <div class="layui-input-inline" style="width: 200px;">
                    <select name="province" class="province-selector" data-value="湖北省" lay-filter="province-1">
                        <option value="">请选择省</option>
                    </select>
                </div>
                <div class="layui-input-inline" style="width: 200px;">
                    <select name="city" class="city-selector" data-value="十堰市" lay-filter="city-1">
                        <option value="">请选择市</option>
                    </select>
                </div>
                <div class="layui-input-inline" style="width: 200px;">
                    <select name="county" class="county-selector" data-value="茅箭区" lay-filter="county-1">
                        <option value="">请选择区</option>
                    </select>
                </div>
            </div>
            </div>

            <pre>
            // Step1. 引入依赖
            let layarea = layui.layarea;
			<br/>

            // Step2. 使用
            layarea.render({
                elem: '#area-select',
                change: function (res) {
                    //选择结果
                    console.log(res);
                }
            });
            <br/>

            </pre>
        </div>
    </div>
</div>
<!--  引入layui框架js文件-->
<script th:src="@{/layuimini/lib/layui-v2.6.3/layui.js}" charset="utf-8"></script>
<script th:src="@{/layuimini/js/lay-config.js?v=1.0.4}" charset="UTF-8"></script>
<script type="text/javascript" th:inline="javascript">
    layui.use(["code", "layarea"], function () {
        let code = layui.code;
        let layarea = layui.layarea;
        let $ = layui.jquery;

        code({
            elem: "pre",
            title: "代码示例",
            encoded: true,
            skin:'notepad', //设置显示风格
            about: false
        });

        layarea.render({
            elem: '#area-select',
            change: function (res) {
                //选择结果
                console.log(res);
            }
        });
    });
</script>
</body>
</html>
